// 导入自己封装的已经连接的mongoose
const mongoose = require('./connect')


// 订单表的schema
const orderSchema = new mongoose.Schema({
    orderNo: Number,
    createdAt: {
        default: +new Date,
        type: Date
    },
    payStatus: String,
    code: String,
    eatWay: String,
    totalPrice: String,
    userId: String,
    dishName: String,
    dishNum: Number
})


const orderModel = mongoose.model('order', orderSchema, 'order')


// 导出model
module.exports = orderModel